package org.idea.qiyu.framework.retry.jdk.config;

import org.idea.qiyu.framework.retry.jdk.core.FastRetryStrategy;
import org.idea.qiyu.framework.retry.jdk.core.RetryStrategy;
import org.idea.qiyu.framework.retry.jdk.core.listener.AbstractRetryListener;
import org.idea.qiyu.framework.retry.jdk.core.listener.RetryListener;

import java.lang.annotation.*;

/**
 * @Author linhao
 * @Date created in 7:17 下午 2021/9/30
 */
@Documented
@Target(value = ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Retry {

    int maxAttempts() default 3;

    int delay() default 3000;

    Class<? extends Throwable>[] value() default {};

    Class<? extends RetryStrategy> strategy() default FastRetryStrategy.class;

    Class<? extends RetryListener> listener() default AbstractRetryListener.class;
}
